package com.kevin.actoviti.day01;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;

/**
 * @Classname ActivitiComplete
 * @Description TODO
 * @Date 2020/6/21 15:14
 * @Created by kevin
 */
public class ActivitiComplete {

    public static void main(String[] args) {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        TaskService taskService = processEngine.getTaskService();
        /*taskService.complete("5002");*/
        Task task = taskService.createTaskQuery().processDefinitionKey("holiday").taskAssignee("王五").singleResult();
        String id = task.getId();
        taskService.complete(id);
    }
}
